class ScoreException02(Exception):

    def __init__(self,score,min_score,max_score):
        self.score = score
        self.min_score = min_score
        self.max_score = max_score

    def __str__(self):
        return "分数异常：输入的分数应该在{}~{}之间，当前输入的分数是{}，请重新输入".format(self.min_score,self.max_score,self.score)

def update_score():
    score = int(input("请输入分数（0~100）："))
    min_score = int(input("请输入分数的最小值："))
    max_score = int(input("请输入分数的最大值："))
    if score > max_score or score < min_score:
        raise ScoreException02(score,min_score,max_score)
    if score < 60:
        print("E")
    elif score < 70:
        print("D")
    elif score < 80:
        print("C")
    elif score < 90:
        print("B")
    else:
        print("A")

while True:
    try:
        update_score()
    except ScoreException02 as e:
        print(e)
    flag = int(input("是否继续（任意数字继续，-1退出程序）："))
    if flag == -1:
        break